import {
	request
} from "./request.js";

export const searchEnterprise = (data = {}) => {
	return request({
		url: "/enterprise/list",
		data
	})
}
export const getEnterpriseDetail = (data = {}) => {
	return request({
		url: `/enterprise/findEnterpriseBackground/${data.id}`
	})
}

export const getEnterpriseId = (data = {}) => {
	return request({
		url: `/enterprise/getDetail/${data.id}/${data.userId}`
	})
}

export const getAllRanking = (data = {}) => {
	return request({
		url: "/enterprise/industries/rankings"
	})
}

export const getExecutiveByEnterpriseId = (data = {}) => {
	return request({
		url: "/enterprise/executive/query",
		data
	})
}

export const getTrademarkByEnterpriseId = (data = {}) => {
	return request({
		url: "/enterprise/trademark/query",
		data
	})
}
export const getPatentByEnterpriseId = (data = {}) => {
	return request({
		url: "/enterprise/patent/query",
		data
	})
}

export const searchPatent = (data = {}) => {
	return request({
		url: '/enterprise/patent/list',
		data
	})
}
export const searchExecutive = (data = {}) => {
	return request({
		url: '/enterprise/executive/list',
		data
	})
}
export const searchTrademark = (data = {}) => {
	return request({
		url: '/enterprise/trademark/list',
		data
	})
}
export const calcRisk = (data = {}) => {
	return request({
		url: `/enterprise/risk/${data.id}`
	})
}

export const addFavorite = (data = {}) => {
	return request({
		url: `/enterprise/favorite/${data.id}/${data.userId}`,
		method: "POST"
	})
}


export const removeFavorite = (data = {}) => {
	return request({
		url: `/enterprise/favorite/${data.id}/${data.userId}`,
		method: "DELETE"
	})
}

export const getFavorites = (data = {}) => {
	return request({
		url: `/enterprise/favorite/${data.id}`
	})

}